package cn.zwx.goods.svc.rpc.dto;

import lombok.Data;
import org.apache.dubbo.apidocs.annotations.RequestParam;
import org.hibernate.validator.constraints.Length;
import org.hibernate.validator.constraints.Range;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.util.List;

/**
 * @author zhangwenxue
 */
@Data
public class InsertAttrDTO {
    @NotBlank(message = "属性名称不能为空")
    @Length(max = 32,message = "属性名称不能超过32位")
    @RequestParam(value = "属性名称",description = "属性名称",required = true)
    private String attrName;

    /**
     * 1:销售属性,2:基本属性
     */
    @NotNull(message = "属性类型不能为空")
    @Range(max = 2,min = 1,message = "属性类型只支持 1:销售属性,2:基本属性")
    @RequestParam(value = "属性类型",description = "属性类型",required = true)
    private Integer attrType;

    /**
     * 属性值
     */
    @NotNull(message = "属性名称不能为空")
    @RequestParam(value = "属性值",required = true,description = "属性值")
    private List<String> attrValueList;

    /**
     * 属性描述
     */
    @NotBlank(message = "属性描述不能为空")
    @Length(max = 200,message = "属性描述不能超过200位")
    @RequestParam(value = "属性描述",description = "属性描述",required = true)
    private String attrDesc;
}
